function [img] = reconDAS(path)

% path -- path of bin data file acquired by the UIH equipment

fp = fopen(path, 'rb');

hdr1 = fread(fp, 1, 'uint8');
hdr2 = fread(fp, 1, 'uint8');
hdr3 = fread(fp, 1, 'uint8');

shotLen = hdr1 + hdr2 * 256 + hdr3 * 256 * 256;
acqLen  = shotLen / 16;

header = fread(fp, 5, 'uint8');

data = fread(fp, 64 * 2 * acqLen, 'uint8');

fclose(fp);

b2 = data(1:2:end); % to multiply 256
b1 = data(2:2:end);

data = b2 * 256 - 65536 * (b2 >= 128) + b1;

data = reshape(data, 4, acqLen * 16);
data = flipud(data);
data = data(:);
rf_data = transpose(reshape(data, 64, acqLen));

% parameters of the transducer
channel_num = 64;
% US parameters
params.fs = 40*1e6; %[Hz]
params.fc = 2.8*1e6; %[Hz]
%params.bandwidth = 10; % [percent]
params.pitch = 0.254e-3; % pitch == spacing [mm]
params.width = 0.254e-3;
params.radius = Inf;
params.c = 1500; % [m/s], the reconstruction sound speed - water 1480 m/s
params.fnumber = []; % determine automatically, for formula see MUST user guide

IQ_US = rf2iq(rf_data,params.fs ,params.fc);

xlen = params.pitch *(channel_num-1)  + params.width;
x = (-xlen/2):1e-4:(xlen/2);
z = 0:0.1e-3:60e-3;% exp：60mm = 60e-3
[X,Z] = meshgrid(x,z); % [mm]

params_US = params;
bfsig_US = das(IQ_US,X,Z,zeros(1,channel_num),params_US);

img = abs(bfsig_US);

end